package com.TwinBlade.PicturePassword;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class GesturePreferences extends Activity
{
  private Spinner a;
  private Spinner b;
  private Spinner c;
  private List d;
  private SharedPreferences e;
  private Context f;

  private String a(String paramString)
  {
    Iterator localIterator = this.d.iterator();
    v localv;
    do
    {
      if (!localIterator.hasNext())
        return "none";
      localv = (v)localIterator.next();
    }
    while (!localv.a.equals(paramString));
    return localv.b;
  }

  private void a()
  {
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator = this.d.iterator();
    while (true)
    {
      if (!localIterator.hasNext())
      {
        ArrayAdapter localArrayAdapter = new ArrayAdapter(this, 17367048, localArrayList);
        localArrayAdapter.setDropDownViewResource(17367049);
        this.a.setAdapter(localArrayAdapter);
        this.b.setAdapter(localArrayAdapter);
        this.c.setAdapter(localArrayAdapter);
        return;
      }
      localArrayList.add(((v)localIterator.next()).a);
    }
  }

  private void b()
  {
    if (a(String.valueOf(this.a.getSelectedItem())).equals("none"))
    {
      this.b.setSelection(0);
      this.c.setSelection(0);
      this.b.setEnabled(false);
      this.c.setEnabled(false);
      this.e.edit().putString("SecondGestureType", "none").commit();
      this.e.edit().putString("ThirdGestureType", "none").commit();
    }
    while (true)
    {
      if (this.b.isEnabled())
      {
        if (!a(String.valueOf(this.b.getSelectedItem())).equals("none"))
          break;
        this.c.setSelection(0);
        this.c.setEnabled(false);
        this.e.edit().putString("ThirdGestureType", "none").commit();
      }
      return;
      this.b.setEnabled(true);
    }
    this.c.setEnabled(true);
  }

  public void finish()
  {
    if ((a(String.valueOf(this.a.getSelectedItem())).equals("none")) && (a(String.valueOf(this.b.getSelectedItem())).equals("none")) && (a(String.valueOf(this.c.getSelectedItem())).equals("none")))
      setResult(0);
    while (true)
    {
      super.finish();
      return;
      setResult(-1);
    }
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903042);
    v[] arrayOfv = new v[4];
    arrayOfv[0] = new v(getString(2131296464), "none");
    arrayOfv[1] = new v(getString(2131296465), "point");
    arrayOfv[2] = new v(getString(2131296466), "line");
    arrayOfv[3] = new v(getString(2131296467), "circle");
    this.d = Arrays.asList(arrayOfv);
    this.f = this;
    this.e = PreferenceManager.getDefaultSharedPreferences(this);
    this.e.edit().putString("FirstGestureData", "0").commit();
    this.e.edit().putString("SecondGestureData", "0").commit();
    this.e.edit().putString("ThirdGestureData", "0").commit();
    this.e.edit().putString("FourthGestureData", "0").commit();
    this.e.edit().putString("FifthGestureData", "0").commit();
    this.e.edit().putString("FourthGestureType", "none").commit();
    this.e.edit().putString("FifthGestureType", "none").commit();
    this.a = ((Spinner)findViewById(2131230728));
    this.b = ((Spinner)findViewById(2131230730));
    this.c = ((Spinner)findViewById(2131230732));
    a();
    this.a.setOnItemSelectedListener(new x(this, null));
    this.b.setOnItemSelectedListener(new y(this, null));
    this.c.setOnItemSelectedListener(new z(this, null));
    b();
    ((Button)findViewById(2131230733)).setOnClickListener(new w(this));
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.TwinBlade.PicturePassword.GesturePreferences
 * JD-Core Version:    0.6.2
 */